Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance(compiler): cache templates per compilation #1224

Merged
merged 1 commit into from
Dec 3, 2024

Conversation

ecrupper
Copy link
Contributor

@ecrupper ecrupper commented Dec 2, 2024

This is a fairly uncommon issue, but whenever folks are looking to use a template multiple times in one build, Vela will fetch that template each time. With this in-memory cache on the compiler object, we can avoid unnecessary calls to the SCM.

@ecrupper ecrupper requested a review from a team as a code owner December 2, 2024 19:06
Copy link

codecov bot commented Dec 2, 2024

Codecov Report

Attention: Patch coverage is 88.46154% with 3 lines in your changes missing coverage. Please review.

Project coverage is 56.91%. Comparing base (21761c9) to head (f42b27e).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
compiler/native/compile.go 72.72% 2 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1224      +/-   ##
==========================================
+ Coverage   56.89%   56.91%   +0.02%     
==========================================
  Files         599      599              
  Lines       32886    32904      +18     
==========================================
+ Hits        18709    18727      +18     
  Misses      13541    13541              
  Partials      636      636              
Files with missing lines Coverage Δ
compiler/native/expand.go 70.15% <100.00%> (+0.95%) ⬆️
compiler/native/native.go 88.61% <100.00%> (+0.28%) ⬆️
compiler/native/compile.go 71.15% <72.72%> (+0.49%) ⬆️

Copy link
Contributor

@KellyMerrick KellyMerrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ecrupper ecrupper merged commit aa973fe into main Dec 3, 2024
12 of 13 checks passed
@ecrupper ecrupper deleted the enhance/same-template-caching branch December 3, 2024 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants